<!--Copyright (C) Kherty.  All rights reserved.-->
<ResourceDictionary
    x:Class="OpenLS.Chart.UI.PropertyResources"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:UI="clr-namespace:OpenLS.UI;assembly=OpenLS.UI">
    <Style TargetType="{x:Type TabControl}">
        <Style.Resources>
            <Style TargetType="{x:Type TabItem}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type TabItem}">
                            <Grid SnapsToDevicePixels="True">
                                <Border BorderThickness="1,1,1,1" Padding="{TemplateBinding Control.Padding}" 
                                        BorderBrush="{TemplateBinding Border.BorderBrush}" 
                                        Name="Bd">
                                    <ContentPresenter RecognizesAccessKey="True" 
                                                      Content="{TemplateBinding HeaderedContentControl.Header}" 
                                                      ContentTemplate="{TemplateBinding HeaderedContentControl.HeaderTemplate}" 
                                                      ContentSource="Header" Name="Content" HorizontalAlignment="Stretch" 
                                                      VerticalAlignment="Stretch" SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
                                </Border>

                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsMouseOver" Value="True">
                                    <Setter TargetName="Bd" Property="Background" Value="{DynamicResource {x:Static UI:OfficeBrushes.ButtonHoverBackgroundKey}}"/>
                                </Trigger>
                                <Trigger Property="IsKeyboardFocused" Value="True">
                                    <Setter TargetName="Bd" Property="Background" Value="{DynamicResource {x:Static UI:OfficeBrushes.ButtonHoverBackgroundKey}}"/>
                                </Trigger>
                                <Trigger Property="IsSelected" Value="True">
                                    <Setter TargetName="Bd" Property="Background" Value="{DynamicResource {x:Static UI:OfficeBrushes.ButtonPressedBackgroundKey}}"/>
                                </Trigger>
                                <MultiTrigger>
                                    <MultiTrigger.Conditions>
                                        <Condition Property="IsMouseOver" Value="True"></Condition>
                                        <Condition Property="IsSelected" Value="True"></Condition>
                                    </MultiTrigger.Conditions>
                                    <Setter TargetName="Bd" Property="Background" Value="{DynamicResource {x:Static UI:OfficeBrushes.ButtonHoverSelectedBackgroundKey}}"/>
                                </MultiTrigger>
                                <MultiTrigger>
                                    <MultiTrigger.Conditions>
                                        <Condition Property="IsMouseOver" Value="False"></Condition>
                                        <Condition Property="IsSelected" Value="False"></Condition>
                                    </MultiTrigger.Conditions>
                                    <Setter TargetName="Bd" Property="BorderBrush" Value="{x:Null}"/>
                                </MultiTrigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                
            </Style>
        </Style.Resources>
        <Setter Property="TabStripPlacement" Value="Left"/>
        <Setter Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
        <Setter Property="Control.Padding" Value="4" />
        <Setter Property="Border.BorderThickness" Value="1" />
        <Setter Property="Border.BorderBrush" Value="#FF8C8E94" />
        <Setter Property="Panel.Background" Value="#FFF9F9F9" />
        <Setter Property="Control.HorizontalContentAlignment" Value="Center" />
        <Setter Property="Control.VerticalContentAlignment" Value="Center" />
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate TargetType="TabControl">
                    <Grid ClipToBounds="True" SnapsToDevicePixels="True" KeyboardNavigation.TabNavigation="Local">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Name="ColumnDefinition0" />
                            <ColumnDefinition Width="0" Name="ColumnDefinition1" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" Name="RowDefinition0" />
                            <RowDefinition Height="*" Name="RowDefinition1" />
                        </Grid.RowDefinitions>
                        <TabPanel IsItemsHost="True" 
                    Name="HeaderPanel" Margin="2,2,2,0" 
                    Panel.ZIndex="1" KeyboardNavigation.TabIndex="1" Grid.Column="0" Grid.Row="0" />
                        <Border BorderThickness="{TemplateBinding Border.BorderThickness}" BorderBrush="{TemplateBinding Border.BorderBrush}" Background="{TemplateBinding Panel.Background}" Name="ContentPanel" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Local" KeyboardNavigation.DirectionalNavigation="Contained" Grid.Column="0" Grid.Row="1">
                            <StackPanel>
                                <ContentPresenter Margin="10 0 10 0" TextElement.FontSize="20" Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=SelectedItem.Header}"/>
                                <ContentPresenter Content="{TemplateBinding TabControl.SelectedContent}" ContentTemplate="{TemplateBinding TabControl.SelectedContentTemplate}" ContentSource="SelectedContent" Name="PART_SelectedContentHost" Margin="{TemplateBinding Control.Padding}" SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
                            </StackPanel>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="TabControl.TabStripPlacement" Value="Bottom">
                            <Setter Property="Grid.Row" TargetName="HeaderPanel" Value="1" />
                            <Setter Property="Grid.Row" TargetName="ContentPanel" Value="0" />
                            <Setter Property="RowDefinition.Height" TargetName="RowDefinition0" Value="*" />
                            <Setter Property="RowDefinition.Height" TargetName="RowDefinition1" Value="Auto" />
                            <Setter Property="FrameworkElement.Margin" TargetName="HeaderPanel" Value="2,0,2,2" />
                        </Trigger>
                        <Trigger Property="TabControl.TabStripPlacement" Value="Left">
                            <Setter Property="Grid.Row" TargetName="HeaderPanel" Value="0" />
                            <Setter Property="Grid.Row" TargetName="ContentPanel" Value="0" />
                            <Setter Property="Grid.Column" TargetName="HeaderPanel" Value="0" />
                            <Setter Property="Grid.Column" TargetName="ContentPanel" Value="1" />
                            <Setter Property="ColumnDefinition.Width" TargetName="ColumnDefinition0" Value="Auto" />
                            <Setter Property="ColumnDefinition.Width" TargetName="ColumnDefinition1" Value="*" />
                            <Setter Property="RowDefinition.Height" TargetName="RowDefinition0" Value="*" />
                            <Setter Property="RowDefinition.Height" TargetName="RowDefinition1" Value="0" />
                            <Setter Property="FrameworkElement.Margin" TargetName="HeaderPanel" Value="2,2,0,2" />
                        </Trigger>
                        <Trigger Property="TabControl.TabStripPlacement" Value="Right">
                            <Setter Property="Grid.Row" TargetName="HeaderPanel" Value="0" />
                            <Setter Property="Grid.Row" TargetName="ContentPanel" Value="0" />
                            <Setter Property="Grid.Column" TargetName="HeaderPanel" Value="1" />
                            <Setter Property="Grid.Column" TargetName="ContentPanel" Value="0" />
                            <Setter Property="ColumnDefinition.Width" TargetName="ColumnDefinition0" Value="*" />
                            <Setter Property="ColumnDefinition.Width" TargetName="ColumnDefinition1" Value="Auto" />
                            <Setter Property="RowDefinition.Height" TargetName="RowDefinition0" Value="*" />
                            <Setter Property="RowDefinition.Height" TargetName="RowDefinition1" Value="0" />
                            <Setter Property="FrameworkElement.Margin" TargetName="HeaderPanel" Value="0,2,2,2" />
                        </Trigger>
                        <Trigger Property="UIElement.IsEnabled" Value="False">
                            <Setter Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>